﻿<!-- 文档类型声明 -->
<!DOCTYPE html> 
<!-- 文档使用中文 -->                 
<html lang = "zh-cn">
  <head>
	<!-- 网页标题 -->
    <title>用户登录</title>
	<!-- 设置当前文档的编码格式 -->
	<meta charset = "utf-8">
	<!-- 设置IE浏览器的解析模式 -->
	<meta http-equiv = "X-UA-Compatible" content = "IE=edge">
	<!-- 设置视窗 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 1.加载Bootstrap的层叠样式表 -->
    <link rel="stylesheet" href="<?php echo base_url();?>/public/css/bootstrap.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
        <script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
  </head>
  <script type = "text/javascript">
	function setCookie(c_name, value, expiredays){
 　　　 var exdate=new Date();
 　　　 exdate.setDate(exdate.getDate() + expiredays);
 　　　 document.cookie=c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
 	}
  </script>
  <body>
    <br><br><br><br>
    <div class = "well col-sm-offset-3 col-sm-5">

    <form class = "form-horizontal" action = "<?php echo site_url('login');?>" method = "post" id = "form">
	
	    <h3 class = "text-info col-sm-offset-4">用户登录</h3>
		<h4 class = "text-danger col-sm-offset-2"><?php echo $login_error;?></h3>
	
		<div class = "form-group">
			<label class = "col-sm-4 control-label" for = "username">用户名：</label>
			<div class = "col-sm-4">
				<input type = "text" class = "form-control" id = "username" placeholder = "用户名" name = "username" value = "<?php echo set_value('username');?>">
			</div>
			<?php echo form_error('username','<p class="help-inline text-danger">','</p>');?>
		</div>
		
		<div class = "form-group">
			<label class = "col-sm-4 control-label" for = "password">密码：</label>
			<div class = "col-sm-4">
				<input type = "password" class = "form-control" id = "password" placeholder = "密 码" name = "password" value = "<?php echo set_value('password');?>">
			</div>
			<?php echo form_error('password','<p class="help-inline text-danger">','</p>');?>
		</div>
		
		<div class = "form-group">
			<label class = "col-sm-4 control-label" for = "checknum">验证码：</label>
			<div class = "col-sm-2" style = "width:100px">
				<input type = "text" class = "form-control" id = "checknum" placeholder = "验证码" name = "checknum" value = "<?php echo set_value('checknum');?>">
			</div>
			<?php echo form_error('checknum','<p class="help-inline text-danger">','</p>')?>
			<div style = "height:20px"><a href = "#" id = "btn1">看不清换一张</a></div>
		</div>
		
		<div class = "col-sm-offset-4" id = "yzm">&nbsp;&nbsp;&nbsp;<?php echo $yzm;?></div>
		
		<div class = "form-group">
			<div class = "col-sm-offset-3">
				<div class = "checkbox text-info">
					<label>
						<input type = "checkbox" onclick = "rempasswd();">记住密码      
					</label>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href = "<?php echo site_url('login/findpwd')?>">找回密码</a>
				</div>
			</div>
		</div>
		
		<div class = "col-sm-offset-3 col-sm-1">
			<button type = "submit" class = "btn btn-default" id = "login">登录</button>
		</div>
		<div class = "col-sm-offset-2 col-sm-6">
			<a href = "<?php echo site_url("login/register")?>" class = "btn btn-default" role = "button">注册</a>
		</div>
		
	</form>
	</div>

    <!-- 2.加载jQuery库，同时加载该库必须在加载bootstrap.min.js之前 -->
    <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
    <!-- 3.加载bootstrap的核心js库 -->
    <script src="<?php echo base_url();?>/public/js/bootstrap.min.js"></script>
	<script type = "text/javascript">
		$(function(){
			$('#btn1').click(function(){
				$('#yzm').load('<?php echo site_url('login/checkword')?>');
			}); 			
		})
		
	</script>
  </body>
</html>